import { pget, ppostJson, post, postFileByFormData } from '@/utils/req';
import { modalApi } from '@/utils/modalReq';

// 车牌指标列表
export function getTableList(query: any) {
  return pget(`${modalApi.carMessage}/license/assetscarlicense/page`, query);
}
// 绑定记录接口
export function getTableHistryList(query: any) {
  return pget(`${modalApi.carMessage}/assetscarlicenserecord/page`, query);
}
// 车牌指标列表
export function getTablePage(query: any) {
  return pget(`${modalApi.carMessage}/license/assetscarlicense/page`, query);
}
// 新增车牌指标
export function addTarget(data: any) {
  return ppostJson(
    `${modalApi.carMessage}/license/assetscarlicense/save`,
    data,
  );
}

// 修改车牌指标
export function editTarget(data: any) {
  return ppostJson(
    `${modalApi.carMessage}/license/assetscarlicense/update`,
    data,
  );
}

// 删除车牌指标
export function deleteTarget(data: { ids: string }) {
  return post(`${modalApi.carMessage}/license/assetscarlicense/remove`, data);
}

// 查看车牌指标
export function viewTarget(query: any) {
  return pget(`${modalApi.carMessage}/license/assetscarlicense/detail`, query);
}

// 指标导入检查
export const importCheck = `${modalApi.carMessage}/license/assetscarlicense/import/check`;

// 指标导入提交
export function importSave(data: any) {
  return postFileByFormData(
    `${modalApi.carMessage}/license/assetscarlicense/import`,
    data,
  );
}

// 导入错误列表
export function getErrorList(query?: any) {
  return pget(
    `${modalApi.carMessage}/assetsaccidentdataprocessing/carLicensePage`,
    query,
  );
}
